<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="rr" uri="http://realtyreg.com" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>

<%-- petr0 20.10.12 20:37 --%>
<form action="/authenticate" method="POST">
    <ul id="loginList">
        <c:if test="${not empty param.login_error}">
            <li>
                <div class="authenticationError">
                    <c:choose>
                        <c:when test="${rr:instanceOf(SPRING_SECURITY_LAST_EXCEPTION, 'org.springframework.security.authentication.AuthenticationServiceException')}">
                            <spring:message code="error.message"/>
                        </c:when>
                        <c:otherwise>
                            <c:out value="${SPRING_SECURITY_LAST_EXCEPTION.message}"/>
                        </c:otherwise>
                    </c:choose>
                </div>
            </li>
        </c:if>
        <li><label for="username">E-mail</label></li>
        <li>
            <input type="text" id="username" name="j_username" tabindex="1"
                   value="<c:if test='${not empty param.login_error}'><c:out value='${SPRING_SECURITY_LAST_USERNAME}'/></c:if>"/>
        </li>
        <li><label for="password"><spring:message code="label.login.password"/></label></li>
        <li><input type="password" id="password" name="j_password" tabindex="2"/></li>
        <li><input type="checkbox" id="rememberMe" name="_spring_security_remember_me" tabindex="3">&nbsp;<label for="rememberMe"><spring:message code="label.login.remember.me"/></label></li>
        <li><button type="submit" tabindex="4"><spring:message code="label.login.login"/></button></li>
        <li><button type="button" onclick="window.location='/register';" tabindex="5"><spring:message code="label.registration"/></button></li>
        <li><a href="/recoverPass" tabindex="6"><spring:message code="label.login.forget.pass"/></a></li>
    </ul>
</form>